const gulp = require("gulp"),
    stylus = require("gulp-stylus"),
    clean = require("gulp-clean-css"),
    watch = require("gulp-watch"),
    rename = require("gulp-rename")

gulp.task("watch", () => {
    return watch("./pages/**/*.styl")
        .pipe(stylus())
        .pipe(clean())
        .pipe(rename((path) => {
            path.extname = ".wxss"
        }))
        .pipe(gulp.dest("."))
})

gulp.task("default", ['watch'])